package com.cbs.android.component.weather.weatherinterface.constant;

/**
 * Created by broche on 6/8/16.
 */
public enum WeatherType {
    CLEAR(0), // 晴天
    PARTLY_CLOUDY(1), // 多云
    CLOUDY(2), // 阴
    RAIN(3), // 雨
    SNOW(4), // 雪
    WIND(5), // 风
    FOG(6), // 雾
    HAZE(7), //霾
    SAND(8), // 沙
    UNKNOW(9); // 未知

    private int value = 0;

    WeatherType(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static WeatherType valueOf(int value) {
        switch (value) {
            case 0:
                return CLEAR;
            case 1:
                return PARTLY_CLOUDY;
            case 2:
                return CLOUDY;
            case 3:
                return RAIN;
            case 4:
                return SNOW;
            case 5:
                return WIND;
            case 6:
                return FOG;
            case 7:
                return HAZE;
            case 8:
                return SAND;
            default:
                return UNKNOW;
        }
    }
}
